<template>
	<view class="recomend_single" @click="detail">
		<view>
			<view style="position: relative;">
				<!-- <view class="te_box" v-if="ware.tag">
					<view class="te" v-for="(item,index) in ware.tag" :key="index">{{item}}</view>
				</view> -->
			
				<image class="photo" 
				
					:src="ware.iimage"
					/>
			</view>
			<view class="name_box">
				
				<view class="name fs-13 one-line" style="margin-bottom: 10rpx;" >{{ware.name}}</view>
			
			</view>
		</view>
		<view class="name_box">
			<view class="price">
				<view class="hidden flex-full">
					<view class="hidden flex-full">
						
						<block>
							<!-- <view v-if="ware.sku[0].market_price!='***'" class="gray_font line_through" style="font-size: 30rpx;">
								¥{{ware.sku[0].cost_price}}</view> -->
                            <text class="red_font" style="font-size: 28rpx;margin-right:5rpx;">¥</text>
							<text class="red_font fs-18">{{ware.money}}</text>
							<text class="xl" v-if="ware.xl>=0">已售{{ware.xl}}</text> 
						</block>

						<!-- -->
					</view>
				</view>
				<!-- <my-stepper v-if="ware.is_del" :val="ware.is_del"></my-stepper>-->
				<view class="iconfont plus" @click="plusCart">
					&#xe600;
				</view> 
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp().globalData;
	const {
		imgRemote
	} = app;
	export default {
		props: ['ware', 'config', 'isActive'],
		data() {
			return {
				imgRemote: imgRemote,
				msg: {}
			}
		},
		onShow() {

		},
		created() {
			//this.getInfo();	
		},
		methods: {
			getInfo() {
				this.$get(this.$api.configLists, {
					names: 'wtj,shz'
				}, res => {
					this.msg = res.data.data;
				});
			},
			showCart() {
				this.$emit('showCart')
			},
			detail() {

		     uni.navigateTo({
		      url: '/pages/fw/info?id='+this.ware.id
	     	})
										
			},
			plusCart() {
				this.ware.is_del = 1;
			}
		}
	}
</script>

<style scoped lang="scss">
	.name_box{
		box-sizing: border-box;
		padding: 0 15rpx;
	}
	.recomend_single {
		height: 100%;
		background: #fff;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		border-radius: 10px;
		width: 338rpx;
		border-radius: 10rpx;
		padding: 0 0 10rpx 0;
		justify-content: space-between;

		.describe {
			width: 100%;
			font-size: 22rpx;
			color: #999;
			margin-top: 20rpx;
		}
	}

	.recomend_single .photo {
		
		width: 100%;
		height: 169px;
		border-radius: 10rpx 10rpx 0 0;
	}

	.recomend_single .price {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.plus {
		height: 46rpx;
		width: 46rpx;
		background:#f44b44;
		color: #fff;
		text-align: center;
		font-size: 36rpx;
		line-height: 46rpx;
		border-radius: 50%;
		margin-bottom: 0rpx;
	}

	.qiang {
		background: $m-c;
		color: white;
		border-radius: 10rpx;
		width: 50rpx;
		display: inline-block;
		height: 45rpx;
		line-height: 45rpx;
		text-align: center;
	}
	
	.jin_box {
		background-color: #F4F5F6;
		font-size: 24rpx;
		box-sizing: border-box;
		padding: 3rpx 10rpx;
		margin: 8rpx 0;
		color: #928E8E;
		border-radius: 8rpx;
	}
	.xian{
		margin: 0 5rpx;
	}
	.te_box{
		
		
		position: absolute;
		right:0rpx;
		top:20rpx;
		display: flex;
		align-items: center;
	}
	.te{
		box-sizing: border-box;
		padding: 0 10rpx;
		height: 55rpx;
		line-height: 55rpx;
		text-align: center;
		border-radius: 15rpx;
		color: white;
		font-weight: bold;
		background-color: #1677fe;
		font-size: 24rpx;
		margin-right:15rpx ;
	}
	
	.xl{
		font-size: 22rpx;
		color: #999;
		margin-left: 15rpx;
	}
</style>